Question: Compute $\cos 135^\circ$.
Solution: Let $P$ be the point on the unit circle that is $135^\circ$ counterclockwise from $(1,0)$, and let $D$ be the foot of the altitude from $P$ to the $x$-axis, as shown below.

[asy]
pair A,C,P,O,D;
draw((0,-1.2)--(0,1.2),p=black+1.2bp,Arrows(0.15cm));
draw((-1.2,0)--(1.2,0),p=black+1.2bp,Arrows(0.15cm));
A = (1,0);
O= (0,0);
label("$x$",(1.2,0),SE);
label("$y$",(0,1.2),NE);

P = rotate(135)*A;
D = foot(P,A,-A);
draw(O--P--D);
draw(rightanglemark(O,D,P,2));
draw(Circle(O,1));
label("$O$",O,SE);
label("$P$",P,NW);
//label("$A$",A,SE);
label("$D$",D,S);
[/asy]

Triangle $POD$ is a 45-45-90 triangle, so $DO = DP = \frac{\sqrt{2}}{2}$.  Therefore, the coordinates of $P$ are $\left(-\frac{\sqrt{2}}{2}, \frac{\sqrt{2}}{2}\right)$, so $\cos 135^\circ = \boxed{-\frac{\sqrt{2}}{2}}$.